//
//  SYClassPlayerCollectionViewCell.m
//  SanYiTeaching
//
//  Created by 郑浩然 on 2019/10/22.
//  Copyright © 2019年 SanYi. All rights reserved.
//

#import "SYClassPlayerCollectionViewCell.h"

@interface SYClassPlayerCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *numberLab;

@end


@implementation SYClassPlayerCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code zy_tab_sp
}

- (void)setPlayerCellTutorModel:(id)tutor playerType:(SYClassPlayerTutorType)type {
    NSString *nameStr = nil;
    NSString *imageName = nil;
    if (type == SYClassPlayerTutorTypeUp) {//第一层首页
        SYPlayerTutorModel *tutorModel = (SYPlayerTutorModel *)tutor;
        nameStr = tutorModel.title;
        imageName = @"zy_collection_xjwjj";
        self.numberLab.text = [NSString stringWithFormat:@"%ld 项",tutorModel.dataTutorRecordArr.count];
    } else if (type == SYClassPlayerTutorTypeRecord) {//第二层页面
        SYPlayerTutorRecordModel *tutorModel = (SYPlayerTutorRecordModel *)tutor;
        nameStr = tutorModel.tutorRecord;
        imageName = @"zy_collection_xjwjj";
        self.numberLab.text = [NSString stringWithFormat:@"%ld 项",tutorModel.dateTutorVideoArr.count];
        
    } else if (type == SYClassPlayerTutorTypeVideo) {//视频播放页面
        SYPlayerTutorVideoModel *tutorModel = (SYPlayerTutorVideoModel *)tutor;
        nameStr = tutorModel.videoName;
        imageName = @"zy_tab_sp";
        self.numberLab.text = tutorModel.createDate;
    }
    
    _bgImageView.image = [UIImage imageNamed:imageName];
    _titleLab.text = nameStr;
}


@end
